<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
    Date.prototype.Format = function (fmt) { //author: meizz
        var o = {
            "M+": this.getMonth() + 1, //月份
            "d+": this.getDate(), //日
            "h+": this.getHours(), //小时
            "m+": this.getMinutes(), //分
            "s+": this.getSeconds(), //秒
            "q+": Math.floor((this.getMonth() + 3) / 3), //季度
            "S": this.getMilliseconds() //毫秒
        };
        if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        return fmt;
    }

    function setIdNo(){
        getBaseinfo('idNo','age');
        getBirthday('idNo','birthdayDate')
    }
    setIdNo();
    function print(clinicId,patientId){
        printPdf('${ctx}/doctor/clinicDeathProve/clinicDeathProvePrint?clinicId='+clinicId, 'patientId='+patientId);
    }
</script>
<div class="panel-body">
    <div class="table-responsive no-border">
        <form id="inputForm"   method="post" class="form-horizontal" onsubmit="return formSaveLoad('rigthDoctorCenterDiv','inputForm','${ctx}/doctor/clinicDeathProve/save','${ctx}/doctor/clinicDeathProve/index?clinicId=${clinicMaster.id}&patientId=${patMasterIndex.id}');">
            <input type="hidden" name="clinicId" value="${clinicMaster.id}" >
            <input type="hidden" name="patientId" value="${patMasterIndex.id}" >
            <input type="hidden" name="patMasterIndex.id" value="${patMasterIndex.id}" >
            <input type="hidden" name="id" value="${clinicDeathProve.id}" >
            <div class="col-lg-11">
               <p align="center"><label><font size="4">居民死亡医学证明（推断）书</font></label></p>

                <div class="opertion_items">
                    <div>基本信息</div>
                </div>
                <fieldset>
                    <div class="table-responsive no-border">
                    <table width="100%" cellspacing="0">
                        <tr align="center">
                            <td width="10%"><label>死者姓名</label></td>
                            <td width="18%">${patMasterIndex.name}
                                <input type="hidden" name="patMasterIndex.name" value="${patMasterIndex.name}"  class="form-control">
                            </td>
                            <td width="10%"><label>性&nbsp;&nbsp;别</label></td>
                            <td width="18%">
                                <sys:select checkValue="${patMasterIndex.sex}" lists="${fns:getDictList('SEX_DICT')}" className="form-control" name="patMasterIndex.sex"></sys:select>
                            </td>
                            <td width="10%"><label>名&nbsp;&nbsp;族</label></td>
                            <td width="10%">
                                <sys:select checkValue="${patMasterIndex.nation}" lists="${fns:getDictList('NATION_DICT')}" className="form-control" name="patMasterIndex.nation"></sys:select>
                            </td>
                            <td width="10%"><label>国家或<br/>地区</label></td>
                            <td width="14%">
                                <sys:select checkValue="${patMasterIndex.nationality}" lists="${fns:getDictList('NATIONALITY_DICT')}" className="form-control" name="patMasterIndex.nationality"></sys:select>
                            </td>
                        </tr>
                        <tr align="center">
                            <td width="10%"><label>有效身份<br/>证件类别</label></td>
                            <td width="18%">
                                <sys:select checkValue="${clinicDeathProve.idType}" lists="${fns:getDictList('ID_TYPE_DICT')}" className="form-control" name="idType"></sys:select>
                            </td>
                            <td width="10%"><label>证件号码</label></td>
                            <td width="18%">
                                <input type="text" data-parsley-checkidcard="3"  id="idNo"  data-parsley-required="true"
                                       maxlength="100" name="patMasterIndex.idNo" onchange="setIdNo()"
                                       value="${patMasterIndex.idNo}" class="form-control">
                            </td>
                            <td width="10%">
                                <label><label>年龄(岁)</label></label>
                            </td>
                            <td width="10%">
                                <input type="number" name="patMasterIndex.age" id="age" value="${patMasterIndex.age}" class="form-control">
                            </td>
                            <td width="10%"><label>婚姻状况</label></td>
                            <td width="14%">
                                <sys:select checkValue="${patMasterIndex.marriage}" lists="${fns:getDictList('MARRIAGE_DICT')}" className="form-control" name="patMasterIndex.marriage"></sys:select>
                            </td>
                        </tr>
                        <tr align="center">
                            <td width="10%"><label>出生日期</label></td>
                            <td width="18%">
                                <input type="text" name="patMasterIndex.birthdayDate"  id="birthdayDate"  data-parsley-required="true"
                                       value="<fmt:formatDate value="${patMasterIndex.birthdayDate}" pattern="yyyy-MM-dd HH:mm:ss" type="date" dateStyle="long" />" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});" class="form-control Wdate">                            </td>
                            <td width="10%"><label>文化程度</label></td>
                            <td width="18%">
                                <sys:select checkValue="${clinicDeathProve.degree}" lists="${fns:getDictList('DEGREE_DICT')}" className="form-control" name="degree"></sys:select>
                            </td>
                            <td width="10%"><label>个人身份</label></td>
                            <td width="34%" colspan="3">
                                <sys:select checkValue="${patMasterIndex.identity}" lists="${fns:getDictList('PROFESSION_DICT')}" className="form-control" name="patMasterIndex.identity"></sys:select>
                            </td>
                        </tr>
                        <tr align="center">
                            <td width="10%"><label>死亡日期</label></td>
                            <td width="18%">
                                <input type="text" name="deathDate"  data-parsley-required="true"  data-parsley-required="true"
                                       value="<fmt:formatDate value="${clinicDeathProve.deathDate}" pattern="yyyy-MM-dd HH:mm:ss" type="date" dateStyle="long" />" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});" class="form-control Wdate">                            </td>
                            <td width="10%"><label>死亡地点</label></td>
                            <td width="28%" colspan="2">
                                <sys:select checkValue="$clinicDeathProve.deathLocation}" lists="${fns:getDictList('DEATH_LOCATION_DICT')}" className="form-control" name="deathLocation"></sys:select>
                            </td>
                            <td width="20%" colspan="2"><label>死亡时是否处于妊娠期<br/>或妊娠期终止后42天内</label></td>
                            <td width="14%">
                                <sys:select checkValue="${clinicDeathProve.gestation}" lists="${fns:getDictList('YES_NO')}" className="form-control" name="gestation"></sys:select>
                            </td>
                        </tr>
                        <tr align="center">
                            <td width="10%"><label>生前<br/>工作单位</label></td>
                            <td width="18%">
                                <input type="text" name="employer" value="${clinicDeathProve.employer}" class="form-control" >
                            <td width="10%"><label>户籍地址</label></td>
                            <td width="28%" colspan="2">
                                <input type="text" name="patMasterIndex.nativePlace" value="${patMasterIndex.nativePlace}" class="form-control" >
                            </td>
                            <td width="10%"><label>常住地址</label></td>
                            <td width="24%" colspan="2">
                                <input type="text" name="patMasterIndex.address" value="${patMasterIndex.address}" class="form-control" >
                            </td>
                        </tr>
                        <tr align="center">
                            <td width="10%"><label>可联系的<br/>亲属姓名</label></td>
                            <td width="18%">
                                <input type="text" name="patMasterIndex.contacts" value="${patMasterIndex.contacts}" class="form-control" >
                            <td width="10%"><label>联系电话</label></td>
                            <td width="28%" colspan="2">
                                <input type="text" data-parsley-mobilephone="ture" name="patMasterIndex.contactsPhone" value="${patMasterIndex.contactsPhone}" class="form-control" >
                            </td>
                            <td width="10%"><label>家庭住址<br/>或工作单位</label></td>
                            <td width="24%" colspan="2">
                                <input type="text" name="patMasterIndex.contactsAddress" value="${patMasterIndex.contactsAddress}" class="form-control" >
                            </td>
                        </tr>
                    </table>
                    </div>
                </fieldset>


                <div class="opertion_items">
                    <div>诊断信息</div>
                </div>
                <fieldset>
                    <div class="table-responsive no-border">
                    <table width="100%" cellspacing="1">
                        <tr align="center">
                            <td width="28%" colspan="2" style="padding-top: 8px;"><label>致死的主要疾病诊断</label></td>
                            <td width="48%" colspan="4" style="padding-top: 8px;"><label>疾病名称（勿填症状体征）</label></td>
                            <td width="24%" colspan="2" style="padding-top: 8px;"><label>发病致死亡大概时间间隔</label></td>
                        </tr>
                        <tr align="center">
                            <td width="28%" colspan="2" style="padding-top: 8px;"><label>Ⅰ.(a)死亡直接原因</label></td>
                            <td width="48%" colspan="4" style="padding-top: 8px;">
                                <input type="text" name="aDisease" value="${clinicDeathProve.aDisease}" class="form-control" >
                            </td>
                            <td width="24%" colspan="2" style="padding-top: 8px;">
                                <input type="text" name="aDate" value="${clinicDeathProve.aDate}" class="form-control" >
                            </td>
                        </tr>
                        <tr align="center">
                            <td width="28%" colspan="2" style="padding-top: 8px;"><label>(b)引起（a）的疾病或情况</label></td>
                            <td width="48%" colspan="4" style="padding-top: 8px;">
                                <input type="text" name="bDisease" value="${clinicDeathProve.bDisease}" class="form-control" >
                            </td>
                            <td width="24%" colspan="2" style="padding-top: 8px;">
                                <input type="text" name="bDate" value="${clinicDeathProve.bDate}" class="form-control" >
                            </td>
                        </tr>
                        <tr align="center">
                            <td width="28%" colspan="2" style="padding-top: 8px;"><label>(c)引起（b）的疾病或情况</label></td>
                            <td width="48%" colspan="4" style="padding-top: 8px;">
                                <input type="text" name="cDisease" value="${clinicDeathProve.cDisease}" class="form-control" >
                            </td>
                            <td width="24%" colspan="2" style="padding-top: 8px;">
                                <input type="text" name="cDate" value="${clinicDeathProve.cDate}" class="form-control" >
                            </td>
                        </tr>
                        <tr align="center">
                            <td width="28%" colspan="2" style="padding-top: 8px;"><label>(d)引起（c）的疾病或情况<br/></label></td>
                            <td width="48%" colspan="4" style="padding-top: 8px;">
                                <input type="text" name="dDisease" value="${clinicDeathProve.dDisease}" class="form-control" >
                            </td>
                            <td width="24%" colspan="2" style="padding-top: 8px;">
                                <input type="text" name="dDate" value="${clinicDeathProve.dDate}" class="form-control" >
                            </td>
                        </tr>
                        <tr align="center">
                            <td width="28%" colspan="2" style="padding-top: 8px;"><label>Ⅱ.其他疾病诊断（促进死亡，但与<br/>导致死亡无关的其他重要情况）</label></td>
                            <td width="48%" colspan="4" style="padding-top: 8px;">
                                <input type="text" name="otherDisease" value="${clinicDeathProve.otherDisease}" class="form-control" >
                            </td>
                            <td width="24%" colspan="2" style="padding-top: 8px;">
                                <input type="text" name="otherDate" value="${clinicDeathProve.otherDate}" class="form-control" >
                            </td>
                        </tr>
                        <tr align="center">
                            <td width="12%"><label>生前主要疾病最高诊断单位</label></td>
                            <td width="54%" colspan="4">
                                <sys:select checkValue="${clinicDeathProve.topUnit}" lists="${fns:getDictList('TOP_UNIT_DICT')}" className="form-control" name="topUnit"></sys:select>
                            </td>
                            <td width="12%"><label>生前主要疾病最高诊断依据</label></td>
                            <td width="22%" colspan="2">
                                <sys:select checkValue="${clinicDeathProve.topBasis}" lists="${fns:getDictList('TOP_BASIS_DICT')}" className="form-control" name="topBasis"></sys:select>
                            </td>
                        </tr>
                        <tr align="center">
                            <td width="10%"colspan="2" align="left"><label>&nbsp;&nbsp;医师签名</label></td>
                            <td width="38%" colspan="3" align="left"><label>医疗卫生<br/>机构盖章</label></td>
                            <td width="10%"><label>填表日期：</label></td>
                            <td width="24%" colspan="3" align="right">
                                <input type="text" name="writeDate" data-parsley-required="true"
                                       value="<fmt:formatDate value="${writeDate}" pattern="yyyy-MM-dd" type="date" />" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" class="form-control Wdate"/>
                        </tr>
                        <tr align="center">
                            <td width="66%" colspan="5" align="left"><label>&nbsp;&nbsp;（以下由编码人员填写）根本死亡原因：</label></td>
                            <td width="34%" colspan="3" align="left"><label>&nbsp;&nbsp;&nbsp;&nbsp;ICD编码：</label></td>
                        </tr>
                    </table>
                    </div>
                </fieldset>
            </div>
            <div class="col-lg-1">
                <button type="submit"  class="btn btn-primary mb5">保存</button>
                <button onclick="print('${clinicMaster.id}','${patMasterIndex.id}')" type="button" class="btn btn-primary">打印</button>
            </div>
        </form>
    </div>
</div>